package com.yc.web.controller;

import com.yc.model.User;
import org.springframework.boot.SpringApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
//@EnableAutoConfiguration
@RequestMapping("/user03")
public class UserInfo {

    @ResponseBody
    @RequestMapping("/{id}")
    public User userInfo(@PathVariable(value="id") Integer id){

        User user=new User(id,"aa","123");
        return user;

    }

    @ResponseBody
    @RequestMapping("/error")
    public User userError(){
        int i= 10 /0;
        User user=new User(2,"aa","123");
        return user;

    }




}
